<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    function sjs(min, max) {
        return Math.floor(Math.random() * (max - min + 1)) + min
    }
    var a = [];
    for (i = 1; i <= 10; i++) {
        var sj = (sjs(20, 60))
        if (a.indexOf(sj) == -1) {
            a.push(sj)
        }else{
            i--
        }
    }
    a.sort(function(a,b){
        return a-b
    })
    console.log(a);

</script>